home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / plain / contrib / dmhgener.tex < prev    next >
Encoding:
Text File  |  1992-08-26  |  7.8 KB  |  217 lines

  1. %
  2. %  Automatic numberer: \EQ for regular equations, \EQQ for several
  3. %    numbered equations in \eqalign sequence.
  4. %  Format of the equation label is (c.e), right justified,
  5. %    where 'c' is the chapter number \Chapno
  6. %    and 'e' the equation number \Eqno. You should set \Chapno at the
  7. %    beginning of the file.
  8. %
  9. \newcount\Eqno
  10. \Eqno=0
  11. \def \EQ   {\global\advance\Eqno by 1\eqno{(\number\Chapno .\number\Eqno)}}
  12. \def \EQQ  {\global\advance\Eqno by 1 &{ (\number\Chapno.\number\Eqno)}}
  13. %
  14. %  Examples:
  15. %
  16. %  $$ x = 3 + i \EQ$$
  17. %  $$ \eqalign {x & = 30 \EQQ \cr
  18. %               y & = 50 \EQQ \cr} $$
  19. %
  20. %
  21. %  Retrieval of an equation number: save it in a box.
  22. %  After display mode, say "\key `number' `space'". Then to retrieve
  23. %    the words "Eq. c.e" do "\copy `number'" or "\box `number'" if you
  24. %    only need to remember it once. The dummy `number' can be any number
  25. %    from 0 to 150, it is not the same as \Eqno. YOU must remember how
  26. %    you keyed a particular equation. The key remains the same, even if
  27. %    you change the order of the equations.
  28. %
  29. \def \key #1 {\setbox#1=\hbox{Eq. \number\Chapno .\number\Eqno}}
  30. %
  31. %  Example: $$ x = y + z \EQ$$ \key71
  32. %           \par As seen above in \copy71, this is a very blah, ...
  33. %
  34. %
  35. %        FIGURES
  36. %
  37. \newcount\Figno
  38. \newcount\FIGNO
  39. \newcount\Figpgno
  40. %
  41. %  Make a numbered page that is blank except for "Figure c.f" at the bottom.
  42. %
  43. \def \figpage {\par \null \vfill \par \centerline {Figure \number \Chapno
  44.            \global \advance \Figpgno by1.\number\Figpgno}\eject}
  45. %
  46. %  Refer to a new figure in the text for the first time.
  47. %
  48. \def \Fig {\global \advance \Figno by1 Figure~\number
  49.            \Chapno .\number\Figno}
  50. %
  51. %  The figure caption always follows \FIG.
  52. %
  53. \def \FIG {\par \noindent \global \advance \FIGNO by1 {\bf FIG. \number
  54.               \Chapno .\number \FIGNO}: }
  55. %
  56. %  Refer to more than one figure in the text for the first time.
  57. %  ... as seen in Figures 5.3-6 ...
  58. %  (I am not sure this works.)
  59. %
  60. \def \Figs #1{{\advance\Figno by1 Figures \number\Chapno
  61.          .\number\Figno}$-$ \global\advance\Figno by#1\number\Figno}
  62. %
  63. %       TABLES
  64. %
  65. \newcount\Tablno
  66. \newcount\rno
  67. %
  68. %  Start each single table out with \Table.
  69. %
  70. \def \Table  {\global \advance \Tablno by1\par \noindent
  71.              {\bf Table \number\Chapno-\number\Tablno}: }
  72. %
  73. %       Tables a, b, c: There is a separate macro for the first one,
  74. %       \Tablea. For all subsequent tables use \Tableb. It uses the
  75. %       same table number as the previous table.
  76. %
  77. \def \Tablea {\global \advance \Tablno by1\par \noindent
  78.              {\bf Table \number\Chapno-\number\Tablno a}: }
  79. \def \Tableb #1:{\par \noindent
  80.              {\bf Table \number\Chapno-\number\Tablno #1}: }
  81. %
  82. %  Refer to a table for the first time in the text. \TABLE
  83. %  ... Table c--n ...
  84. %
  85. \def \TABLE {\global \advance \Tablno by1Table~\number \Chapno --\number
  86.              \Tablno}
  87. %
  88. %  Use \skiptable to skip over a sideways table, but keep numbering correct.
  89. %  It also leaves a single blank, numbered page.
  90. %
  91. \def \skiptable {\global \advance \Tablno by1\null \eject}
  92. %
  93. %  Make two lines across, slightly separated.
  94. %
  95. \def \linet {\smallskip \hrule \nobreak \smallskip \hrule \smallskip}
  96. %
  97. %     CHAPTERS
  98. %
  99. \newcount\Chapno
  100. \Chapno=0
  101. %
  102. %  To start a new chapter: \Chapno should be set at zero for the first
  103. %    chapter, one for chapter 2, etc. because \Chap increments \Chapno.
  104. %    It also initializes the figure, table, and reference counters.
  105. %
  106. \def \Chap #1{\global \Eqno=0\global \rno=0
  107.    \global \Figno=0
  108.    \global \FIGNO=0
  109.    \global \Figpgno=0
  110.    \global \Tablno=0
  111.    \global \advance \Chapno by1\null \vskip 1in
  112.    \global \Tablno=0\global \Figno=0\global \rno=0
  113.    \line {\bf CHAPTER \number \Chapno \hfil}
  114.    \bigskip
  115.    \line {\bf #1\hfil} \vskip2pc}
  116. %
  117. %        SECTIONS
  118. %
  119. %   Follow \sect with the section label and title. These macros are NOT
  120. %     automatic numberers.
  121. %
  122. \def \sect #1{\vskip20pt \par\noindent{\bf #1}\vskip10pt\nobreak\par\nobreak}
  123. \def \subsect #1{\vskip10pt \par\noindent{\bf #1}\vskip10pt\nobreak\par\nobreak}
  124. %
  125. %        REFERENCES
  126. %
  127. %   \genref
  128. %   General references - for cases that don't fit into the special macros
  129. %     defined below, there is always this one.
  130. %
  131. %   Note the format of the argument list. This is very important. The argument
  132. %     comes after a left parenthesis, and before a right parenthesis that is
  133. %     immediately followed by a blank space. A right parenthesis followed by
  134. %     a carriage return will not do.
  135. %
  136. \def \genref (#1) {{\global\advance\rno by1{}$^{\number\rno}$
  137.          \advance\rno by 150\global \setbox\number\rno =\vtop
  138.          {\advance\rno by -150\item{\number\rno. }{\rm #1}.}}}
  139. %
  140. %  \ref
  141. %  Regular references. (Multiple authors; one journal; volume; page; year)
  142. %
  143. \def \ref (#1;#2;#3;#4;#5) {\genref ({{\rm #1}, {\sl #2}, {\bf #3},
  144. {\rm #4 (#5)}}) }
  145. %
  146. %  book references - underlines the title
  147. %  \refb (author; title; publisher; city(optionally, state); year; misc)
  148. %
  149. %  The title is in math mode so one has to put the spaces between words
  150. %    in with "\ " or smaller ones with "\,"
  151. \def \refb (#1;#2;#3;#4;#5;#6) {{\global\advance\rno by1{}$^{\number\rno}$
  152.        \advance\rno by 150\global \setbox\number\rno =\vtop
  153.        {\advance\rno by -150\item{\number\rno. }{\rm #1},
  154.        $\underline{\rm #2}$, (#3, #4, #5) \rm #6.}}}
  155. %
  156. %  In a book references - underlined
  157. %  This is for when the person quoted only wrote a part of a book.
  158. %
  159. \def \refi (#1;#2;#3;#4;#5;#6;#7;#8) {{\global\advance\rno by1{}$^{\number\rno}$
  160.     \advance\rno by 150\global \setbox\number\rno =\vtop
  161.     {\advance\rno by -150\item{\number\rno. }{\rm #1, in:}
  162.     $\underline{\rm #2}$, Vol. #3, ed. #4 (#5, #6, #7), #8.}}}
  163. %
  164. % in a book references - italicized. It is easier to italicize than underline,
  165. %   especially when the title is very long.
  166. %
  167. \def \refit(#1;#2;#3;#4;#5;#6;#7;#8){{\global\advance\rno by1{}$^{\number\rno}$
  168.     \advance\rno by 150\global \setbox\number\rno =\vtop
  169.     {\advance\rno by -150\item{\number\rno. }{\rm #1, in:}
  170.     {\it #2}, Vol. #3, ed. #4 (#5, #6, #7), #8.}}}
  171. %
  172. %  comma references - When two papers are referenced at the same time, this
  173. %    will put a comma before the second number in the superscript.
  174. %
  175. \def \refc (#1;#2;#3;#4;#5) {{\global\advance\rno by1$\! \!^{,\number\rno}$
  176.    \advance\rno by 150\global \setbox\number\rno =\vtop
  177.    {\advance\rno by -150\item{\number\rno. }{\rm #1}, {\sl
  178.    #2}, {\bf #3}, {\rm #4 (#5)}.}}}
  179. %
  180. %  Several references, a, b, c. Use with \genref.
  181. %  Example (using _ to point out the required space bars):
  182. %       "\genref (\refabc (a)(author1;journal1;vol1;page1;year1)_;_
  183. %            \refabc (b)(author2;journal2;vol2;page2;year2)_)_"
  184. %
  185. %  It is good to put the semicolon in between reference (a) and (b).
  186. %  This can't be part of the macro because then the reference would
  187. %    end with a semicolon.
  188. %
  189. \def \refabc (#1)(#2;#3;#4;#5;#6) {{\rm #1) #2}, {\sl #3}, {\bf #4},
  190.                {\rm #5 (#6)}}
  191. %
  192. % 2 part Multi-referencer
  193. %
  194. %  Refer to a group of papers in the text, with a hyphen in between,
  195. %    as in 18-22.  \multiref does not store the references at the end.
  196. %    One needs to use \genrefnoi, in general, or \refbox, for simple
  197. %    cases, for that.
  198. %
  199. \def\multiref #1{{\advance \rno by1{}$^{\number \rno
  200.                 -{\advance \rno by#1\number\rno}}$}}
  201. %
  202. %  \refbox
  203. %  This will put a reference in the list at the end without having
  204. %    to refer to it in the text. This is useful if you have references in
  205. %    tables.
  206. %
  207. \def \refbox (#1;#2;#3;#4;#5) {\genrefnoi ({{\rm #1}, {\sl #2}, {\bf #3},
  208.      {\rm #4 (#5)}}) }
  209. %
  210. % \genrefnoi does not put a superscript in the text. This is useful if
  211. %   you need references in the list, but you refer to them in some outside
  212. %   part, such as a table.
  213. %
  214. \def\genrefnoi (#1) {{\global \advance \rno by 1 \advance \rno by
  215.                150\global \setbox \number \rno=\vtop {\advance
  216.                \rno by -150\item {\number \rno. }{\rm #1}.}}}
  217.